local CommonOHOH = _G.CommonOHOH;
local M = CommonOHOH.class.new(script, CommonOHOH.files.BaseComponent());

--武器掉落
function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);
    
    self.Battle=self.parent.Battle

    self.isDropWeapon=self.parent.cfg.isDropWeapon
	
    if self.isDropWeapon==1 then
        self.parent.DieEvent:Connect(function(attacker)
            -- 战斗中的所有玩家都活得奖励
            for _,player in pairs(self.Battle:GetAllPlayerList()) do

                local levelId=self.parent.attribute.LevelId

                local  Common_WeaponDropCtrl=player:GetComponent(CommonOHOH.load.Common_WeaponDropCtrl())
                Common_WeaponDropCtrl:DropWeapon(self.Battle:GetId(),levelId)
            end
        end)
    end
   
end;

function M.dtor(self)
	M.super.dtor(self);
end






return M